﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;

namespace bmapi.Controllers
{
    public class LoadStyleController : PageController
    {
        // POST: api/LoadStyle
        /// <summary>
        /// 款式导入
        /// </summary>
        /// save_model 普通文件2，普通文件夹0，加法模式文件夹1，减法模式文件夹-1
        /// <param name="obj">is_model是否是模板,save_model模板存储模式,brand品牌,sex人群,type服装品类</param>
        public void Post(dynamic obj)
        {
            int save = Convert.ToInt32(obj.save_model);
            int isnodel = Convert.ToInt32(obj.save_model);
            string brand = obj.brand.ToString();
            string sex = obj.sex.ToString();
            string type = obj.type.ToString();
            int loginid = GetCrrentIDByToken();
            //获取用户目录  
            string userPath = HttpContext.Current.Server.MapPath("/" + loginid);
            if (save == 2)
            {
                //普通文件模式下获取所有文件的文件名  
                string[] filesname = Directory.GetFiles(userPath, "*.prj");
                //所有文件 
                Directory.GetFiles(userPath);
            }
            else
            {

            }
        }
    }
}
